package cn.service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import cn.dao.MemberDao;
import cn.dao.MemberDaoImpl;
import cn.pojo.Member;
import cn.util.Page;

public class MemberServiceImpl implements MemberService {
    private MemberDao memberDao = new MemberDaoImpl();

    @Override
    public List<Member> getMemberById(Integer id) {
        return memberDao.getMemberById(id);
    }

    @Override
    public int addMember(Member m) {
        return memberDao.addMember(m);
    }

    @Override
    public int updateMember(Member m) {
        return memberDao.updateMember(m);
    }

    @Override
    public int deleteMember(Integer id) {
        return memberDao.deleteMember(id);
    }

    @Override
    public Member getMemberByPassAndName(String userName, String passWord) {
        return memberDao.getMemberByPassAndName(userName, passWord);
    }

    @Override
    public Member login(String userName, String passWord) {
        return memberDao.login(userName, passWord);
    }

    @Override
    public int getSumLikeName(String userName) {
        return memberDao.getSumLikeName(userName);
    }

    @Override
    public List<Member> getMemberLikeName(String userName) {
        return memberDao.getMemberLikeName(userName);
    }

    @Override
    public Page<Member> getMemberByPageNum(Integer pagaNum) {
        return memberDao.getMemberByPageNum(pagaNum);
    }

    @Override
    public Page<Member> getMemberByPageNumAndUserName(Integer pageNum, String userName) {
        return memberDao.getMemberByPageNumAndUserName(pageNum, userName);
    }

    @Override
    public Page<Member> getMemberByUserNameAndTel(Integer pageNum, String userName, String telNum) {
        return memberDao.getMemberByUserNameAndTel(pageNum, userName, telNum);
    }

    @Override
    public Page<Member> getMemberByUserNameAndTelAndBirthday(Integer pageNum, String telNum, String userName,
                                                             Date startBirthday, Date endBirthday) {
        return memberDao.getMemberByUserNameAndTelAndBirthday(pageNum, telNum, userName, startBirthday, endBirthday);
    }

    @Override
    public int[] deleteMemberBatch(List<Integer> list) {
        return memberDao.deleteMemberBatch(list);
    }

    @Override
    public Map<String, Integer> updateMemberById(Member m) {
        return memberDao.updateMemberById(m);
    }
}
